/*
 * @Author: xiaotiwen
 * @Date: 2020-05-25 10:44:49
 * @LastEditTime: 2020-07-17 16:37:11
 * @LastEditors: xiaotiwen
 * @FilePath: \eduweb\src\api\practiceManagement\practiceTask.js
 * @Description: 实习任务分班
 */

import fetch from 'common/src/utils/fetch';
import baseUrl from './env';
import UTILS from "common/src/utils/utils";

// 列表
export function getList(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassInfo/query`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 分班
export function divideClass(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassInfo/placement`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 取消分班
export function cancelDdivide(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassInfo/cancelPlacement`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 详情
export function getDetails(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassInfo/getAllDetails`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 列表叠加详情
export function listDdetails(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassInfo/getSomeCourse`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 合并课程
export function unionCourses(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassInfo/unionCourses`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 取消合并
export function cancelUnion(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassInfo/cancelUnion`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 是否排课
export function isSchedule(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassInfo/isSchedule`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 获取课程排课时间
export function getSettingTime(data) {
    return fetch({
        url: `${baseUrl}/udgPtSettingT/getSettingTime`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
//导出
export function exportData(data) {
    return fetch({
        url: `${baseUrl}/udgPtClassInfo/exportTable`,
        method: "post",
        responseType: "blob",
        data
    }).then(res => {
        UTILS.downloadFile(
            res,
            "实习任务分班.xls",
            "application/vnd.ms-excel;charset=utf-8"
        );
    });
}
